home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 January / macformat-033.iso / mac / Shareware City / Developers / ABox.v1.8 / Header Files / ABSlide.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-23  |  4.4 KB  |  164 lines  |  [TEXT/MMCC]

  1. /*    
  2.     Copyright © 1991-1995 by TopSoft Inc.  All rights reserved.
  3.  
  4.     You may distribute this file under the terms of the TopSoft
  5.     Artistic License, accompanying this package.
  6.     
  7.     This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
  8.     See the Modification History for more details.
  9.  
  10. Product
  11.     About Box
  12.  
  13. FILE
  14.     ABSlide.h
  15.  
  16. NAME
  17.     ABSlide.h, part of the ABox project source code,
  18.     responsible for handling the AboutBox resource (element) class stuff.
  19.  
  20. DESCRIPTION
  21.     This file contains defines for the about box modules.
  22.     
  23. DEVELOPED BY
  24.     George (ty) Tempel                netromancr@aol.com
  25.     All code in this file, and its associated header file was
  26.     Created by George (ty) Tempel in connection with the TopSoft, Inc.
  27.     "FilterTop" application development, except where noted.
  28.  
  29. CARETAKER - George (ty) Tempel <netromancr@aol.com>
  30.      Please consult this person for any changes or suggestions to this file.
  31.  
  32. MODIFICATION HISTORY
  33.  
  34.     dd mmm yy    -    xxx    -    patchxx: description of patch
  35.     9 June 94    -    ty    -    Initial Version Created
  36.     20-july-94    -    ty    -    initial version released
  37.     23-may-95    -    ty    -    changes for compatibility with the CodeWarrior CW6
  38.                             release and the associated Universal Headers from Apple:
  39.                             most methods that returned references now have "Ref" at
  40.                             the end of their methods names to prevent possible collisions
  41.                             with datatypes and classes of the same name (older versions
  42.                             of the compiler didn't have a problem with this).
  43.  
  44. */
  45.  
  46. /*===========================================================================*/
  47.  
  48. /*========== Exclusion Macros ============*/
  49.  
  50. #pragma    once
  51.  
  52. #ifndef    _ABSlide_
  53. #define    _ABSlide_
  54.  
  55.  
  56. /*============ Header Files ==============*/
  57.  
  58. #include    "ABLinkedList.h"
  59. #include    "ABResource.h"
  60. #include    "ABUFonts.h"
  61.  
  62.  
  63. /*=========== External Linkage ===========*/
  64.  
  65. /*================ Macros ================*/
  66.  
  67. /*============== Constants ===============*/
  68.  
  69. #define    kABSlideMaximumElements            (5)
  70.  
  71.  
  72. #define    kABSlideNumber                    'Snum'
  73. #define    kABSlideNumberSize                (sizeof(short))
  74.  
  75. #define    kABSlideIndex                    'Sidx'
  76. #define    kABSlideIndexSize                (sizeof(ABIndex))
  77.  
  78. #define    kABSlideNumberOfElements        'Snel'
  79. #define    kABSlideNumberOfElementsSize    (sizeof(ABListCount))
  80.  
  81.  
  82. /*================ Enums =================*/
  83.  
  84. //    SlideElementPositions is used by ResizeFields() to adjust
  85. //    where the various slide elements are positioned within the slide
  86. //    area. The names refer primarily to the relationship between
  87. //    a PICT and a TEXT resource, since they occupy the greatest
  88. //    amount of real estate within the slide.
  89. typedef enum {
  90.     leftOrRight = 1,
  91.     aboveOrBelow = 2
  92. }    SlideElementPositions;
  93.  
  94.  
  95. /*=============== Structs ================*/
  96.  
  97. /*=============== Typedefs ===============*/
  98.  
  99. /*=========== Class Definitions ==========*/
  100.  
  101. #define    kABSlideSuperProperties    ABObject
  102. class    ABSlide : public ABLink, public ABObject
  103. {
  104.     friend class ABLinkedList;
  105.     
  106.     public:
  107.                         ABSlide(void);
  108.         virtual            ~ABSlide(void);
  109.  
  110.         virtual    OSErr    GetProperty (ABProperty prop, void *ptr, long *ptrSize);
  111.         virtual    OSErr    SetProperty (ABProperty prop, void *ptr, long ptrSize);
  112.         
  113.         virtual    OSErr    Draw(WindowPtr window);
  114.         virtual    OSErr    Update(WindowPtr window);
  115.         virtual    Boolean    Event(EventRecord *event);
  116.         virtual    OSErr    Stop(void);
  117.         
  118.         virtual    ABResource    *GetResourceOfType(ResType type);
  119.         
  120.         virtual    OSErr    Resize (Rect const *field);
  121.  
  122.         virtual    OSErr    InitializeObject(void);
  123.         
  124.         virtual    OSErr    AddResource(ABResource *object);
  125.         virtual    OSErr    DropResource(ABResource *object);
  126.         
  127.     protected:
  128.         
  129.         virtual    OSErr    ForEach (ABMessage message, void *data);
  130.         
  131.                 Boolean    HasResources(void) const { return this->Resources() != NULL; }
  132.                 Boolean    DoesntHaveResources(void) const { return !this->HasResources(); }
  133.                 
  134.                 short GetSlideNumber(void) const { return this->SlideNumber(); }
  135.                 
  136.                 Boolean IsInitialized(void) const { return this->Initialized() == true; }
  137.                 Boolean IsNotInitialized(void) const { return ! this->IsInitialized(); }
  138.                 Boolean IsntInitialized(void) const { return this->IsNotInitialized(); }
  139.                 
  140.                 
  141.     private:
  142.                 ABLinkedList*    mResources;
  143.                 short            mSlideNumber;
  144.                 Boolean            mInitialized;
  145.                 
  146.                 ABLinkedList*&    Resources(void) const { return this->mResources; }
  147.                 short&            SlideNumber(void) const { return this->mSlideNumber; }
  148.                 Boolean&        Initialized(void) const { return this->mInitialized; }
  149.                 
  150.                 void            ResetResources(void);
  151.                 
  152. };
  153.  
  154.  
  155.  
  156.  
  157. /*========== Function Prototypes =========*/
  158.  
  159.  
  160.  
  161.  
  162. #endif    // _ABSlide_
  163.  
  164.